/**
 * @param {HTMLElement} el
 * @param {string} styleName
 * @returns {string}
 */
export function getElementStyle(el: HTMLElement, styleName: string): string {
  if (!el || !styleName) return ''
  try {
    const computed = document.defaultView?.getComputedStyle(el, '')
    return computed ? computed[styleName as keyof CSSStyleDeclaration] as string : ''
  } catch (e) {
    return ''
  }
} 